/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.pretorius.question1.encapsulation.model;

import java.math.BigDecimal;

/**
 *
 * @author griddy
 */
public class Account {

    public Account(long accountNumber, BigDecimal accountBalance) {
        this.accountNumber = accountNumber;
        this.accountBalance = accountBalance;
    }

    public BigDecimal getAccountBalance() {
        return accountBalance;
    }

    public void setAccountBalance(BigDecimal accountBalance) {
        this.accountBalance = accountBalance;
    }

    public long getAccountNumber() {
        return accountNumber;
    }

    public void setAccountNumber(long accountNumber) {
        this.accountNumber = accountNumber;
    }
    
    public boolean increaseBalance(BigDecimal amt)
    {
        this.accountBalance.add(amt);
        
        return true;
    }
    
    public boolean decreaseBalance(BigDecimal amt)
    {
        
        if(accountBalance.compareTo(amt) != -1)
        {
            accountBalance = accountBalance.subtract(amt);
            return true;
        }
        else
            return false;
            
    }
    
    
    private long accountNumber;
    private BigDecimal accountBalance;
    
    
    
   
    
    
    
}
